<?php
class Admin_GroupUserController extends Zend_Controller_Action{
	private $_model;
	public function init(){
		
		$this->_model = new Application_Model_DbTable_GroupUser();
	
	}
	
	public function indexAction(){
	
		$filters = array();
	
		//từ khóa
		$keyword = $this->_request->getParam('keyword','');
		$filters['keyword']=$keyword;
		$this->view->keyword = $keyword;
	
		
	
		// sắp xếp | order
		$order = $this->_request->getParam('order',"");
		if($order!=""){
			list($orderBy,$orderType) = explode('-', $order);
		}else{
			$orderBy=null;
			$orderType=null;
		}
	

		//get item count per page
		$icpp = $this->_request->getParam('icpp',20);
	
		//get current page number
		$currentPage = $this->_request->getParam('page',1);
	
		$list = $this->_model->getList($filters,$orderType,$orderBy);
	
		// pagination
		$paginator = Zend_Paginator::factory($list);
		$paginator->setCurrentPageNumber($currentPage);
		$paginator->setItemCountPerPage($icpp);
		$paginator->setPageRange(5);
	
		//assign to view
		$this->view->paginator=$paginator;

	}
	
	public function insertAction(){
		
	}
	
	public function updateAction(){
		
	}
	
	public function deleteAction(){
	
	}
}















